﻿using System;
using System.Collections.Generic;

namespace BrmMall.Ship.DaDa
{

    public class JsonModel<T>
    {
        /// <summary>
        /// 返回码 -1 系统异常, 0 错误, 1 正常
        /// </summary>
        public int Code { get; set; }

        /// <summary>
        /// 返回的实体
        /// </summary>
        public T Result { get; set; }

        /// <summary>
        /// 响应状态，成功为"success"，失败为"fail"
        /// </summary>
        public string Status { get; set; }

        public string Msg { get; set; }
    }

    /// <summary>
    /// 城市代码
    /// </summary>
    public class CityCodeModel
    {
        /// <summary>
        /// 城市代码
        /// </summary>
        public string CityCode { get; set; }
        /// <summary>
        /// 城市名
        /// </summary>
        public string CityName { get; set; }
    }

    /// <summary>
    /// 查询配送运费实体
    /// </summary>
    public class QueryFeeModel
    {
        /// <summary>
        /// 配送距离(单位：米)
        /// </summary>
        public double Distance { get; set; }
        /// <summary>
        /// 实际运费(单位：元)，运费减去优惠券费用
        /// </summary>
        public double Fee { get; set; }
        /// <summary>
        /// 运费(单位：元)
        /// </summary>
        public double DeliverFee { get; set; }
        /// <summary>
        /// 平台订单号
        /// </summary>
        public string DeliveryNo { get; set; }
    }

    /// <summary>
    /// 添加订单实体
    /// </summary>
    public class AddOrderModel
    {
        /// <summary>
        /// 配送距离(单位：米)
        /// </summary>
        public double Distance { get; set; }
        /// <summary>
        /// 实际运费(单位：元)，运费减去优惠券费用
        /// </summary>
        public double Fee { get; set; }
        /// <summary>
        /// 运费(单位：元)
        /// </summary>
        public double DeliverFee { get; set; }
        /// <summary>
        /// 运费(单位：元)
        /// </summary>
        public double CouponFee { get; set; }
        /// <summary>
        /// 优惠券费用(单位：元)
        /// </summary>
        public double Tips { get; set; }
        /// <summary>
        /// 保价费(单位：元)
        /// </summary>
        public double InsuranceFee { get; set; }
    }

    /// <summary>
    /// 订单实体
    /// </summary>
    public class GetOrderModel
    {
        /// <summary>
        /// 第三方订单编号
        /// </summary>
        public string orderId { get; set; }
        /// <summary>
        /// 	订单状态(待接单＝1 待取货＝2 配送中＝3 已完成＝4 已取消＝5 已过期＝7 指派单=8 妥投异常之物品返回中=9 妥投异常之物品返回完成=10 系统故障订单发布失败=1000 可参考文末的状态说明）
        /// </summary>
        public int statusCode { get; set; }
        /// <summary>
        /// 订单状态消息
        /// </summary>
        public string statusMsg { get; set; }
        /// <summary>
        /// 	骑手姓名
        /// </summary>
        public string transporterName { get; set; }
        /// <summary>
        /// 骑手电话
        /// </summary>
        public string transporterPhone { get; set; }
        /// <summary>
        /// 骑手经度
        /// </summary>
        public double transporterLng { get; set; }
        /// <summary>
        /// 骑手纬度
        /// </summary>
        public double transporterLat { get; set; }
        /// <summary>
        /// 配送费,单位为元
        /// </summary>
        public double deliveryFee { get; set; }
        /// <summary>
        /// 小费,单位为元
        /// </summary>
        public double tips { get; set; }
        /// <summary>
        /// 实际支付费用,单位为元
        /// </summary>
        public double actualFee { get; set; }
        /// <summary>
        /// 配送距离,单位为米
        /// </summary>
        public double distance { get; set; }
        /// <summary>
        /// 发单时间
        /// </summary>
        public string createTime { get; set; }
        /// <summary>
        /// 收货码
        /// </summary>
        public string orderFinishCode { get; set; }
    }

    /// <summary>
    /// 取消订单实体
    /// </summary>
    public class CacelOrderModel
    {
        /// <summary>
        /// 扣除的违约金(单位：元)
        /// </summary>
        public decimal deduct_fee { get; set; }
    }

    /// <summary>
    /// 取消理由实体
    /// </summary>
    public class CacelReasonModel
    {
        /// <summary>
        /// 理由编号
        /// </summary>
        public int id { get; set; }
        /// <summary>
        /// 取消理由
        /// </summary>
        public string reason { get; set; }
    }


    /// <summary>
    /// 门店实体
    /// </summary>
    public class ShopModel
    {
        public ShopModel(string origin_shop_id)
        {
            this.origin_shop_id = origin_shop_id;
            this.status = 1;
            this.business = 1;
        }
        /// <summary>
        /// 门店编码,可自定义,但必须唯一;若不填写,则系统自动生成
        /// </summary>
        public string origin_shop_id { get; set; }
        /// <summary>
        /// 门店名称
        /// </summary>
        public string station_name { get; set; }
        /// <summary>
        /// 业务类型(食品小吃-1,饮料-2,鲜花-3,文印票务-8,便利店-9,水果生鲜-13,同城电商-19, 医药-20,蛋糕-21,酒品-24,小商品市场-25,服装-26,汽修零配-27,数码-28,小龙虾-29, 其他-5)
        /// </summary>
        public int business { get; set; }
        /// <summary>
        /// 城市名称(如,上海)
        /// </summary>
        public string city_name { get; set; }
        /// <summary>
        /// 区域名称(如,浦东新区)
        /// </summary>
        public string area_name { get; set; }
        /// <summary>
        /// 门店地址
        /// </summary>
        public string station_address { get; set; }
        /// <summary>
        /// 门店经度
        /// </summary>
        public double lng { get; set; }
        /// <summary>
        /// 门店纬度
        /// </summary>
        public double lat { get; set; }
        /// <summary>
        /// 联系人姓名
        /// </summary>
        public string contact_name { get; set; }
        /// <summary>
        /// 联系人电话
        /// </summary>
        public string phone { get; set; }
        /// <summary>
        /// 门店状态（1-门店激活，0-门店下线）
        /// </summary>
        public int status { get; set; }
    }
    
    /// <summary>
    /// 更新门店实体
    /// </summary>
    public class UpdateShopModel : ShopModel
    {
        public UpdateShopModel(string origin_shop_id,string new_shop_id) : base(origin_shop_id)
        {
            this.new_shop_id = new_shop_id;
        }
        /// <summary>
        /// 新的门店编码 
        /// </summary>
        public string new_shop_id { get; set; }
    }

    /// <summary>
    /// 添加门店的接口返回实体
    /// </summary>
    public class AddShopModel
    {
        /// <summary>
        /// 成功数量
        /// </summary>
        public int success { get; set; }
        /// <summary>
        /// 添加成功的门店
        /// </summary>
        public List<ShopModel> SuccessList { get; set; }
        /// <summary>
        /// 添加失败的门店
        /// </summary>
        public List<AddShopFailModel> FailedList { get; set; }
    }

    /// <summary>
    /// 添加门店错误实体
    /// </summary>
    public class AddShopFailModel
    {
        /// <summary>
        /// 门店编号
        /// </summary>
        public string shopNo { get; set; }
        /// <summary>
        /// 门店名称
        /// </summary>
        public string shopName { get; set; }
        /// <summary>
        /// 错误消息
        /// </summary>
        public string msg { get; set; }
    }

    /// <summary>
    /// 账户余额
    /// </summary>
    public class BalanceModel
    {
        /// <summary>
        /// 运费账户余额
        /// </summary>
        public decimal deliverBalance { get; set; }
        /// <summary>
        /// 红包账户余额
        /// </summary>
        public decimal redPacketBalance { get; set; }
    }
}